﻿using IceZero.DataStore;
using IceZero.DataStore.Models;
using System.Linq;

namespace IceTodo.Core.Managers
{
    /// <summary>
    /// 用户管理器
    /// </summary>
    public partial class TodoUserDataStore: DataStoreBase<TodoUser>
    {
        public TodoUser GetUserById(string id)
        {
            TodoUser user = null;
            NHibernateHelper.UseSession(session =>
            {
                user = session.Query<TodoUser>().FirstOrDefault(u => u.Id == id);
            });
            return user;
        }
    }
}
